package tests;

import common.Utils;
import org.openqa.selenium.By;

public class PrizeListPage extends Utils {

    private static String url = "http://82.156.185.199:8080/admin.html";

    public PrizeListPage() {
        super(url);
    }

    public void testPage(){
        // 切换回主页面（关键！）
        driver.switchTo().defaultContent();
        driver.findElement(By.cssSelector("body > div.cont-box > div.sidebar > ul > li:nth-child(2) > ul > li:nth-child(1) > a")).click();
        driver.switchTo().frame(0);
        // "奖品列表"
        driver.findElement(By.cssSelector("body > div > h2"));
        // "奖品id"
        driver.findElement(By.cssSelector("body > div > div.table-box > table > thead > tr > th:nth-child(1)"));
        // "奖品图"
        driver.findElement(By.cssSelector("body > div > div.table-box > table > thead > tr > th:nth-child(2)"));
        // "奖品名"
        driver.findElement(By.cssSelector("body > div > div.table-box > table > thead > tr > th:nth-child(3)"));
        // "奖品描述"
        driver.findElement(By.cssSelector("body > div > div.table-box > table > thead > tr > th:nth-child(4)"));
        // "奖品价值"
        driver.findElement(By.cssSelector("body > div > div.table-box > table > thead > tr > th:nth-child(5)"));
        // "首页" 按钮
        driver.findElement(By.cssSelector("body > div > div.pagination > button:nth-child(1)"));
        // "上一页" 按钮
        driver.findElement(By.cssSelector("body > div > div.pagination > button:nth-child(2)"));
        // "下一页" 按钮
        driver.findElement(By.cssSelector("body > div > div.pagination > button:nth-child(4)"));
        // "尾页" 按钮
        driver.findElement(By.cssSelector("body > div > div.pagination > button:nth-child(5)"));
    }
}
